package fr.umlv.m2.jee.pmlv.persistence.ldapLink.dao;

import org.springframework.stereotype.Repository;

import fr.umlv.m2.jee.pmlv.framework.dao.hibernate.AbstractHibernateDAO;
import fr.umlv.m2.jee.pmlv.persistence.ldapLink.UserCursus;
import fr.umlv.m2.jee.pmlv.persistence.ldapLink.UserCursusPK;
import java.util.List;

@Repository("hibernateUserCursusDAO")
public class HibernateUserCursusDao 
				extends AbstractHibernateDAO<UserCursusPK, UserCursus >  
				implements IUserCursusDAO {
    
    @Override
	public List<UserCursus> findByUserUidAndByYear(String uid, int year) {
		String query = "from UserCursus as uc where uc.primaryKey.uid = '"+uid+"' and uc.primaryKey.year="+year;
		return findByQuery(query);
	}
}